from django import forms

from book.models import Article


class MyForm(forms.ModelForm):
    class Meta:
        model = Article
        fields = '__all__'
        exclude = ["title",
                   "content",
                   "author ",
                   "categor",
                   "create_time"]
        error_messages = {"title":
                              {'max_length': '最多不能超过10个字符!',
                               'min_length': "最少不能少于3个字符", }}
        # "min_length":'最少不能少于3个字符!'},"content":{"required"
        # :
        # "必须输入content!"}
